import type { CartItem } from '@/types/cart'
import { http } from '@/utils/http'

//postMemberCartAPI   加入购物车 /member/cart
export const postMemberCartAPI = (data: { skuId: string; count: number }) =>
  http({
    url: '/member/cart',
    method: 'POST',
    data,
  })
//获取购物车详情 /member/cart
export const getMemberCartAPI = () =>
  http<CartItem[]>({
    url: '/member/cart',
    method: 'GET',
  })

//删除购物车
export const delMemberCartAPI = (data: { ids: string[] }) =>
  http({
    url: '/member/cart',
    method: 'DELETE',
    data,
  })
